﻿USE [master]
GO
/****** Object:  Database [CustomProviders]    Script Date: 09/25/2012 16:56:15 ******/
CREATE DATABASE [CustomProviders] ON  PRIMARY 
( NAME = N'CustomProviders', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\CustomProviders.mdf' , SIZE = 2048KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'CustomProviders_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\CustomProviders_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [CustomProviders] SET COMPATIBILITY_LEVEL = 100
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [CustomProviders].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [CustomProviders] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [CustomProviders] SET ANSI_NULLS OFF
GO
ALTER DATABASE [CustomProviders] SET ANSI_PADDING OFF
GO
ALTER DATABASE [CustomProviders] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [CustomProviders] SET ARITHABORT OFF
GO
ALTER DATABASE [CustomProviders] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [CustomProviders] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [CustomProviders] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [CustomProviders] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [CustomProviders] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [CustomProviders] SET CURSOR_DEFAULT  GLOBAL
GO
ALTER DATABASE [CustomProviders] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [CustomProviders] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [CustomProviders] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [CustomProviders] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [CustomProviders] SET  DISABLE_BROKER
GO
ALTER DATABASE [CustomProviders] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [CustomProviders] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [CustomProviders] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [CustomProviders] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [CustomProviders] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [CustomProviders] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [CustomProviders] SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [CustomProviders] SET  READ_WRITE
GO
ALTER DATABASE [CustomProviders] SET RECOVERY SIMPLE
GO
ALTER DATABASE [CustomProviders] SET  MULTI_USER
GO
ALTER DATABASE [CustomProviders] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [CustomProviders] SET DB_CHAINING OFF
GO
USE [CustomProviders]
GO
/****** Object:  Table [dbo].[tbl_Roles]    Script Date: 09/25/2012 16:56:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tbl_Roles](
	[RoleID] [uniqueidentifier] NOT NULL,
	[Rolename] [varchar](50) NULL,
	[Rolecode] [varchar](10) NULL,
	[Description] [varchar](max) NULL,
	[IsActive] [bit] NULL,
	[CreationDate] [datetime] NULL,
	[ModifiedDate] [datetime] NULL,
 CONSTRAINT [PK_tbl_Roles] PRIMARY KEY CLUSTERED 
(
	[RoleID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[tbl_Members]    Script Date: 09/25/2012 16:56:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tbl_Members](
	[UserID] [uniqueidentifier] NOT NULL,
	[Firstname] [varchar](50) NULL,
	[Middlename] [varchar](50) NULL,
	[Lastname] [varchar](50) NULL,
	[Gender] [varchar](2) NULL,
	[Email] [varchar](50) NULL,
	[Alt_Email] [varchar](50) NULL,
	[BusinessPhone] [varchar](15) NULL,
	[MobilePhone] [varchar](15) NULL,
	[Username] [varchar](20) NULL,
	[Password] [varchar](20) NULL,
	[PasswordQuestion] [varchar](max) NULL,
	[PasswordAnswer] [varchar](max) NULL,
	[IsLocked] [bit] NULL,
	[IsActive] [bit] NULL,
	[CreationDate] [datetime] NULL,
	[ModifiedDate] [datetime] NULL,
 CONSTRAINT [PK_tbl_Members] PRIMARY KEY CLUSTERED 
(
	[UserID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[tbl_Members] ([UserID], [Firstname], [Middlename], [Lastname], [Gender], [Email], [Alt_Email], [BusinessPhone], [MobilePhone], [Username], [Password], [PasswordQuestion], [PasswordAnswer], [IsLocked], [IsActive], [CreationDate], [ModifiedDate]) VALUES (N'076c3f8a-4bd9-49bd-ae8e-58bda2cab9a8', N'Praveen', N'', N'Mantapam', N'M', N'praveenm@zsl.com', N'praveen.mantapam@live.com', N'(123) 456-7890', N'9176746329', N'praveenm', N'password', N'What is ZSL', N'Zylog Systems Limited', 0, 1, CAST(0x0000A0D700F41273 AS DateTime), CAST(0x0000A0D700F41273 AS DateTime))
/****** Object:  Table [dbo].[tbl_MemberRoles]    Script Date: 09/25/2012 16:56:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbl_MemberRoles](
	[MemberRoleID] [uniqueidentifier] NOT NULL,
	[MemberID] [uniqueidentifier] NULL,
	[RoleID] [uniqueidentifier] NULL,
	[CreationDate] [datetime] NULL,
	[ModifiedDate] [datetime] NULL,
 CONSTRAINT [PK_tbl_MemberRoles] PRIMARY KEY CLUSTERED 
(
	[MemberRoleID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[tbl_LoginHistory]    Script Date: 09/25/2012 16:56:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tbl_LoginHistory](
	[UserID] [uniqueidentifier] NULL,
	[LoginTime] [datetime] NULL,
	[LogoutTime] [datetime] NULL,
	[LoginLocation] [varchar](max) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  ForeignKey [FK_tbl_MemberRoles_tbl_Members]    Script Date: 09/25/2012 16:56:16 ******/
ALTER TABLE [dbo].[tbl_MemberRoles]  WITH CHECK ADD  CONSTRAINT [FK_tbl_MemberRoles_tbl_Members] FOREIGN KEY([MemberID])
REFERENCES [dbo].[tbl_Members] ([UserID])
GO
ALTER TABLE [dbo].[tbl_MemberRoles] CHECK CONSTRAINT [FK_tbl_MemberRoles_tbl_Members]
GO
/****** Object:  ForeignKey [FK_tbl_MemberRoles_tbl_Roles]    Script Date: 09/25/2012 16:56:16 ******/
ALTER TABLE [dbo].[tbl_MemberRoles]  WITH CHECK ADD  CONSTRAINT [FK_tbl_MemberRoles_tbl_Roles] FOREIGN KEY([RoleID])
REFERENCES [dbo].[tbl_Roles] ([RoleID])
GO
ALTER TABLE [dbo].[tbl_MemberRoles] CHECK CONSTRAINT [FK_tbl_MemberRoles_tbl_Roles]
GO
/****** Object:  ForeignKey [FK_tbl_LoginHistory_tbl_Members]    Script Date: 09/25/2012 16:56:16 ******/
ALTER TABLE [dbo].[tbl_LoginHistory]  WITH CHECK ADD  CONSTRAINT [FK_tbl_LoginHistory_tbl_Members] FOREIGN KEY([UserID])
REFERENCES [dbo].[tbl_Members] ([UserID])
GO
ALTER TABLE [dbo].[tbl_LoginHistory] CHECK CONSTRAINT [FK_tbl_LoginHistory_tbl_Members]
GO
